Campaign Manager - Creative Builder
Text Manipulation FunctionsText manipulation functions can be used anywhere a variable or action is used, for example in the content or in a variable definition. APPEND - {var}.append([arg1] [arg2])arg1 - string to append if {var} is not null. arg2 - string to append if {var} is null - this argument is optional. example - {name}.append([, welcome!]) if {name} = "Jack" then result = "Jack, welcome!" PREPEND - {var}.prepend([arg1] [arg2]arg1 - string to prepend if {var} is not null. arg2 - string to prepend if {var} is null - this argument is optional example - {name}.prepend([Hello]) if {name} = "Jack" then result = "Hello Jack" CAPITALIZE - {var}.capitalizeCapitlizes the first letter of {var} UPPERCASE - {var}.uppercase translate {var} to all uppercase REPLACE - {var}.replace([arg1] [arg2]arg1 - search string arg2 - replace string FORMATDATE - {var}.formatdate([arg1]) arg1 - output format where:d - day of the month, no leading zero dd - two digit day of the month, leading zero ddd - three letter abbreviated day of the week dddd - full day M - numeric month, leading zero MM - numeric month, no leading zero MMM - three letter abbreviated month MMMM - full month y - year without century, no leading zero yy - year without century, leading zero yyyy - four digit year gg - period era h - 12-hour clock hour, no leading zero hh - 12-hour clock hour, leading zero H - 24-hour clock hour, no leading zero HH - 24-hour clock hour, leading zero m - minute, no leading zero mm - minute, leading zero s - second, no leading zero ss - second, leading zero f - fraction of a second, single digit precision ff - fraction of a second, double digit precision fff - fraction of a second, three digit precision ffff - fraction of a second, four digit precision fffff - fraction of a second, five digit precision ffffff - fraction of a second, six digit precision fffffff - fraction of a second, seven digit precision t - single digit AM/PM indicator tt - AM/PM designator z - "+" or "-" followed by time zone offset hour, no leading zero zz - "+" or "-" followed by time zone offset hour, leading zero zzz - "+" or "-" followed by full time zone offset hour and minutes, leading zeros example - {date}="12/13/2003" {date}.formatdate([ddd dd MMMM, yyyy]) = "Wed 13 December, 2015" FORMATNUMBER - {var}.formatnumber([arg1])arg1 - output format where: None - Displays the number with no formatting (0) - Digit placeholder. Displays a digit or a zero. If the expression has a digit in the position where the zero appears in the format string, display it; otherwise, displays a zero in that position. If the number has fewer digits than there are zeros (on either side of the decimal) in the format expression, displays leading or trailing zeros. If the number has more digits to the right of the decimal separator than there are zeros to the right of the decimal separator in the format expression, rounds the number to as many decimal places as there are zeros. If the number has more digits to the left of the decimal separator than there are zeros to the left of the decimal separator in the format expression, displays the extra digits without modification. (#) - Digit placeholder. Displays a digit or nothing. If the expression has a digit in the position where the # character appears in the format string, displays it; otherwise, displays nothing in that position. This symbol works like the 0 digit placeholder, except that leading and trailing zeros aren't displayed if the number has fewer digits than there are # characters on either side of the decimal separator in the format expression. (.) - Decimal placeholder. The decimal placeholder determines how many digits are displayed to the left and right of the decimal separator. If the format expression contains only # characters to the left of this symbol; numbers smaller than 1 begin with a decimal separator. To display a leading zero displayed with fractional numbers, use zero as the first digit placeholder to the left of the decimal separator. (%) - Percent placeholder. Converts the expression to a percentage. The percent character (%) is inserted in the position where it appears in the format string. (,) - Thousand separator. The thousand separator separates thousands from hundreds within a number that has four or more places to the left of the decimal separator. (:) - Time separator. The time separator separates hours, minutes, and seconds when time values are formatted. (/) - Date separator. The date separator separates the day, month, and year when date values are formatted. (E- E+ e- e+) - Scientific format. If the format expression contains at least one digit placeholder (0 or #) to the left of E-, E+, e-, or e+, the number is displayed in scientific format and E or e is inserted between the number and its exponent. The number of digit placeholders to the left determines the number of digits in the exponent. Use E- or e- to place a minus sign next to negative exponents. Use E+ or e+ to place a minus sign next to negative exponents and a plus sign next to positive exponents. You must also include digit placeholders to the right of this symbol to get correct formatting. - + $ ( ) - Literal characters. These characters are displayed exactly as typed in the format string. To display a character other than one of those listed, precede it with a backslash (\) or enclose it in double quotation marks (" "). (\) - Displays the next character in the format string. To display a character that has special meaning as a literal character, precede it with a backslash (\). The backslash itself isn't displayed. Using a backslash is the same as enclosing the next character in double quotation marks. To display a backslash, use two backslashes (\\). Examples of characters that can't be displayed as literal characters are the date-formatting and time-formatting characters (a, c, d, h, m, n, p, q, s, t, w, y, /, and :), the numeric-formatting characters (#, 0, %, E, e, comma, and period), and the string-formatting characters (@, &, <, >, and !). ("ABC") - Displays the string inside the double quotation marks (" "). To include a string in the style argument from within code, you must use Chr(34) to enclose the text (34 is the character code for a quotation mark (")) Example: {variable1}=12345 {variable1}.formatnumber([##,###]) = 12,345 SUBSTRING - {var}.substring([arg1] [arg2])returns characters of {var} between index values arg1 and arg2. LENGTH - {var}.lengthreturns number of characters in {var} ADD - {var}.add([arg1]){var} and arg1 are integers, add {var} and arg1 SUB - {var}.sub([arg1]){var} and arg1 are integers, subtract {var} and arg1 INDEXOF - {var}.indexof([arg1])returns starting position of character string arg1 in {var} example: {var} = "test@mail.com" {var}.indexof([@]) = 4 IFEQUALS{var}.ifequals([arg1] [arg2] [arg3]) if {var} = "arg1" then "arg2" else "arg3" "arg3" is optional. TRIM - {var}.trimremoves leading and trailing spaces from {var} TRANSLATE - {var}.translate([string default] [param list]returns the nth parameter in the [param list] counting from zero where n = {var}, if there is no match return string default. example: {var} = 3 then {var}.translate([] [zero] [one] [two] [three] [four] [five]) = "three" URLENCODE - {var}.urlencode URLDECODE - {var}.urldecode HTMLENCODE - {var}.htmlencode HTMLDECODE - {var}.htmldecode NOBASEPATH - {action}.nobasepathUsed with actions that need to be formatted as relative URLs Example, when an action is included in a querystring. CASUALNAME - {var}.casualnameGenerates a casual name (in most cases the first name) Rules include
Some examples of usage are: "MR PETER_WENTOVICH JR") -> [Peter] ("K R_LANGSTON") -> [K R Langston] ("MR R_GRIMM") -> [R Grimm] ("MRS LINDA_GURGANUS") -> [Linda] ("MS SHERRY_GRAY") -> [Sherry] ("MISS SHERRY L_HILL") -> [Sherry] ("MISS KIM M_CIPOLLA") -> [Kim] ("MR KENNETH R_RAMEY JR") -> [Kenneth] ("JENA_ARGROVES") -> [Jena] ("DR SCOTT_AARONS") -> [Scott] ("REV JOSEPH W_KENSHOL") -> [Joseph] (" Allan J O'Driscoll") -> [Allan] ("A. O'Driscoll") -> [A. O'Driscoll] ("O'Driscoll, Allan ") -> [Allan] (" Golden, Jr., David ") -> [David] ("Mr O'Driscoll") -> [O'Driscoll] LONGSTATE - {var}.longstateTranslates postal state codes to their corresponding full English spelling. Examples: "CA" -> California "IL" -> Illinois "NY" -> New York |
Online & Instructor-Led Courses | Training Videos | Webinar Recordings | ![]() |
|
![]() |
© Alterian. All Rights Reserved. | Privacy Policy | Legal Notice | ![]() ![]() ![]() |